import React, { Component } from 'react'
import './index.less'
import LoadMore from 'uxcore-load-more'
import PropTypes from 'prop-types'
import { observer } from 'mobx-react/custom'

@observer
export default class LoadMoreInfo extends Component {
  render () {
    console.log(this.props.status)
    if (this.props.status === 'noMore') return <div />
    return <LoadMore status={this.props.status} trigger={['view', 'click']}
      noMoreText={'没有更多啦'}
      onLoadMore={() => {
        this.props.handleLoadMore && this.props.handleLoadMore()
      }} />
  }
}

LoadMoreInfo.defaultProps = {
  status: 'noMore'
}

LoadMoreInfo.propTypes = {
  status: PropTypes.string,
  handleLoadMore: PropTypes.func
}
